import App from './App'


// #ifdef VUE3

import uviewPlus from '@/uni_modules/uview-plus'
import {createSSRApp} from 'vue'
import store from "./store"; // 引入 Vuex Store
import {Tool} from '/common/tool';
import {Request} from '/common/request';


export function createApp() {
  const app = createSSRApp(App)
  // 创建 Tool 实例
  const tool = new Tool();
  // 全局挂载 Tool 到 $tool
  app.config.globalProperties.$tool = tool;
  // 创建 Tool 实例
  const request = new Request();
  // 全局挂载 Tool 到 $tool
  app.config.globalProperties.$request = request;


  // 挂载 $u.toast 到全局
  app.use(uviewPlus)
  app.use(store); // 注册 Vuex
  return {
    app
  }
}

// #endif
